<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import parcel from '@/api/document/parcel'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'
import useParcel from "@/utils/crud/useParcel.js";

const crudRef = ref()



const switchStatus = (statusValue, id, statusName) => {
  parcel.changeStatus({ id, statusName, statusValue }).then( res => {
    res.success && Message.success(res.message)
  }).catch( e => { console.log(e) } )
}


const options = reactive({
  id: 'parcel',
  pageLayout: 'fixed',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  formOption: {
    viewType: 'drawer',
    width: 600
  },
  requestParams:{
    'keep_tab': 1
  },
  api: parcel.getList,
})

const columns = useParcel.columns
</script>
<script> export default { name: 'document:parcel' } </script>